package com.um.pasantiaum.cliente;
import com.parse.ParseUser;
import com.um.pasantiaum.DispatchActivity;
import com.um.pasantiaum.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;


public class HistorialActivity extends Activity {
	private Button mPedidosAbiertos;
	private Button mPedidosCerrados;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.historial_main);
			
		mPedidosAbiertos = (Button)findViewById(R.id.pedidos_abiertos);
		mPedidosAbiertos.setOnClickListener(new OnClickListener() {
			
			
			public void onClick(View v) {
				Intent i = new Intent(HistorialActivity.this, PedidosAbiertosActivity.class);
				Log.d("HistorialActivity", "pedidosAbiertos");

				startActivity(i);
				
			}
		});
		
		
		mPedidosCerrados = (Button)findViewById(R.id.pedidos_finalizados);
		mPedidosCerrados.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(HistorialActivity.this, PedidosCerradosActivity.class);
			Log.d("HistorialActivity", "Pedidos Finalizados");

			startActivity(i);
			
				
			}
		});
		
	}
		
	
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {		
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.log_out_menu, menu);
		return true;
	}
	

	/*public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		switch (item.getItemId()){
		case R.id.log_out:
			ParseUser.logOut();
			// Start and intent for the dispatch activity
	        Intent intent = new Intent(HistorialActivity.this, DispatchActivity.class);
	        startActivity(intent);
	        return true;
	    default:
			return super.onOptionsItemSelected(item);
		}
	}

*/
	}


